#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@file: main.py
@time: create by fanxl12 on 2020-05-17
"""
__author__ = 'fanxl12'

from flask import render_template

from . import web
from ..models.gift import Gift
from ..view_models.book import BookViewModel


@web.route('/')
def index():
    recent_gifts = Gift.recent()
    books = [BookViewModel(gift.book) for gift in recent_gifts]
    return render_template('index.html', recent=books)


@web.route('/personal')
def personal_center():
    pass